package com.kexinde.wjifen.model;

import java.util.Date;

import javax.persistence.Entity;

/**
 * 消费记录
 * 
 * @author WEI
 *
 */
@Entity
public class Consumption {

	/**
	 * 主键
	 */
	private Long id;
	
	/**
	 * 消费时间
	 */
	private Date time = new Date();
	
	/**
	 * 消费金额
	 */
	private Double money = 0.0;
	
	/**
	 * 用户id（外键）
	 */
	private Long userId = 0L;
	
	/**
	 * 商店id（外键）
	 */
	private Long shopId = 0L;
	
	/**
	 * 员工id（外键）
	 */
	private Long stuffId = 0L;

	/**
	 * 构造方法
	 * 动态创建实例，用于数据库读写时，反射获取对象
	 *
	 * @param id
	 * @param time
	 * @param money
	 * @param userId
	 * @param shopId
	 * @param stuffId
	 */
	public Consumption(Long id, Date time, Double money, Long userId,
			Long shopId, Long stuffId) {
		super();
		this.id = id;
		this.time = time;
		this.money = money;
		this.userId = userId;
		this.shopId = shopId;
		this.stuffId = stuffId;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getShopId() {
		return shopId;
	}

	public void setShopId(Long shopId) {
		this.shopId = shopId;
	}

	public Long getStuffId() {
		return stuffId;
	}

	public void setStuffId(Long stuffId) {
		this.stuffId = stuffId;
	}

	/**
	 * 用于测试
	 */
	@Override
	public String toString() {
		return "Consumption [id=" + id + ", time=" + time + ", money=" + money
				+ ", userId=" + userId + ", shopId=" + shopId + ", stuffId="
				+ stuffId + "]";
	}
	
}
